###################################################################################################
## Payson (2021) When Cities Lobby Replication Code
## Chapter Five Appendix: Tables A5.1 - A5.8, Figures, and On-line Only SI
## Created with R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
###################################################################################################


## Load packages
library(maps); library(ggplot2); library(scales); library(RColorBrewer); 
library(tidyverse); library(effects);  library(stargazer); library(lfe); 
library(fect); library(gutenbergr); library(tidytext)


## Set working directory
setwd()


## Functions for clean tex tables (need to define to compile tables)
pretty <- function(x) {
  paste(prettyNum(x, big.mark = ","))}

num.cities <- function(x) {
  length(which(getfe(x)=="fips"))}

N <- function(x) {
  x$N}

getmean <- function(x) {
  round(mean(x$response), 1)}



###################################################################################################
## Table A5.1 Correlates of State Transfers to Cities
###################################################################################################

dta <- read.csv("city_lobby_finance.csv")

m <- felm(state.pp ~ lobby + log.pop + log.inc + log.own.source + 
            pct.white + log.home + bachelors.degree | state + year, data = dta)

m1 <- felm(state.pp ~ lobby + log.pop + log.inc + log.own.source + 
             pct.white + log.home + bachelors.degree | state.by.year, data = dta)


## Tabel: Correlates of State Transfers to Cities
stargazer(m, m1, omit.table.layout = "sn", type = "text", star.cutoffs = c(0.05),
          title = c("\\textbf{Correlates of State Transfers to Cities}."),
          dep.var.caption = "State Transfers (Per Capita)",
          covariate.labels = c("Lobby", "Population (Log)", "Median Income (Log)", 
                               "Own Source Revenue (Log)", 
                               "\\% White", "Median House Value (Log)", 
                               "\\% College Degree"),
          add.lines = list(c("State FEs", "Yes", ""), c("Year FEs", "Yes", ""),
                           c("State-Year FEs", "", "Yes"),
                           c("Observations", pretty(N(m)), 
                             pretty(N(m1))),
                           c("\\# Cities", "4,589", "4,589"),
                           c("Mean Transfer", getmean(m), getmean(m1))))



###################################################################################################
## Table A5.2 Effect of Lobbying on State Transfers
###################################################################################################

dta <- read.csv("city_lobby_finance.csv")

m <- felm(state.pp ~ lobby + log.pop | fips + year | 0 | fips, data = dta)


m1 <- felm(state.pp ~ lobby + log.pop + log.inc + log.own.source + 
             pct.white + log.home | fips + year | 0 | fips, data = dta)


m2 <- felm(state.pp ~ lobby + log.pop | fips + state.by.year | 0 | fips,data = dta)


m3 <- felm(state.pp ~ lobby + log.pop + log.inc + log.own.source + 
             pct.white + log.home | fips + state.by.year | 0 | fips, data = dta)


stargazer(m, m1, m2, m3, omit.table.layout = "s", type = "text", 
          star.cutoffs = c(0.05),
          font.size = "small", keep=c("lobby"), covariate.labels = c("Lobby"), 
          title = c("\\textbf{Effect of Lobbying on State Transfers.}"),
          dep.var.caption = "State Transfers (Per Capita), $t + 1$", 
          dep.var.labels.include = FALSE, 
          add.lines = list(c("City FEs", "Yes", "Yes", "Yes", "Yes"),
                           c("Year FEs", "Yes", "Yes", ""),
                           c("State-Year FEs", "", "", "Yes", "Yes"),
                           c("Full Controls", "", "Yes", "", "Yes"),
                           c("Observations", pretty(m$N), pretty(m1$N), 
                             pretty(m2$N), pretty(m3$N)),
                           c("\\# Cities", pretty(num.cities(m)), pretty(num.cities(m1)), 
                             pretty(num.cities(m2)), pretty(num.cities(m3))),
                           c("Mean Transfer", getmean(m), getmean(m1), 
                             getmean(m2), getmean(m3))),
          notes.append = FALSE, notes.align = "l", notes.label  = "",
          notes = "Robust standard errors clustered by city. $^{*}$p$<$0.05")


###################################################################################################
## Table A5.3 Effect of Lobbying on State Transfers By City Size
###################################################################################################

dta <- read.csv("city_lobby_finance.csv")


m <- felm(state.pp ~ lobby + log.pop | fips + year | 0 | fips, data = dta)

m1 <- felm(state.pp ~ lobby + log.pop | fips + year | 0 | fips, 
           data = subset(dta, pop.cat == "medium" | pop.cat == "small"))

m2 <- felm(state.pp ~ lobby + log.pop | fips + year | 0 | fips, 
           data = subset(dta, pop.cat == "big"))

m3 <- felm(state.pp ~ lobby + log.pop | fips + year | 0 | fips, 
           data = subset(dta, pop.cat == "urban"))



stargazer(m, m1, m2, m3, omit.table.layout = "sn", type = "text",
          star.cutoffs = c(0.05), font.size = "small",
          table.placement = "t", label = "table:returns_bysize",
          title = c("\\textbf{Effect of Lobbying on State Transfers By City Size}"),
          dep.var.caption = "State Transfers (Per Capita)", dep.var.labels.include = FALSE,
          column.labels = c("Full Sample", "Under 50,000", "50,000 - 100,000", "Over 100,000"), 
          keep = "lobby", covariate.labels = c("Lobby"),
          add.lines = list(c("City FEs", "Yes", "Yes", "Yes", "Yes"),
                           c("Year FEs", "Yes", "Yes", "Yes", "Yes"),
                           c("Observations", pretty(m$N), pretty(m1$N), pretty(m2$N), pretty(m3$N)),
                           c("\\# Cities",  pretty(num.cities(m)), pretty(num.cities(m1)), 
                             pretty(num.cities(m2)), pretty(num.cities(m3))),
                           c("Mean Transfer", getmean(m), getmean(m1), getmean(m2), getmean(m3))))



###################################################################################################
## Table A5.4 Effect of Lobbying on State Transfers (Logged)
###################################################################################################

dta <- read.csv("city_lobby_finance.csv")

m <- felm(log.state1 ~ lobby + log.pop | fips + year | 0 | fips, data = dta)

m1 <- felm(log.state1 ~ lobby + log.pop | fips + year | 0 | fips, 
           data = subset(dta, pop.cat == "small" | pop.cat == "medium"))

m2 <- felm(log.state1 ~ lobby + log.pop | fips + year | 0 | fips, 
           data = subset(dta, pop.cat == "big"))

m3 <- felm(log.state1 ~ lobby + log.pop | fips + year | 0 | fips, 
           data = subset(dta, pop.cat == "urban"))


stargazer(m, m1, m2, m3, omit.table.layout = "sn", type = "text", star.cutoffs = c(0.05),
          font.size = "small", keep=c("lobby"), covariate.labels = c("Lobby"), 
          title = c("\\textbf{Effect of Lobbying on State Transfers (Logged)}"),
          dep.var.caption = "State Transfers (Logged)", 
          dep.var.labels.include = FALSE, 
          column.labels = c("Full Sample", "Under 50,000", "50,000 - 100,000", "Over 100,000"), 
          add.lines = list(c("City FEs", "Yes", "Yes", "Yes", "Yes"),
                           c("Year FEs", "Yes", "Yes", "Yes", "Yes"),
                           c("Observations", pretty(m$N), pretty(m1$N), 
                             pretty(m2$N), pretty(m3$N)),
                           c("\\# Cities", pretty(num.cities(m)), pretty(num.cities(m1)), 
                             pretty(num.cities(m2)), pretty(num.cities(m3))),
                           c("Mean Transfers Per Capita", getmean(m), getmean(m1), 
                             getmean(m2), getmean(m3))))



###################################################################################################
## Table A5.5 City Lobbying and State Transfers: Lags and Leads
###################################################################################################

dta <- read.csv("city_lobby_finance.csv")

## Drop extreme outliers and limit sample to cities with at least 5 observations

m <- felm(state.pp1 ~ lobby + log.pop |
            fips + year, subset(dta, total.cog > 4 & state.pp1 < 2000))

m1 <- felm(state.pp1 ~ lobby.lead1 + lobby + log.pop | 
             fips + year, subset(dta, total.cog > 4 & state.pp1 < 2000))

m2 <- felm(state.pp1 ~ lobby.lead1 + lobby + lobby.lag1 + log.pop | 
             fips + year, subset(dta, total.cog > 4 & state.pp1 < 2000))

m3 <- felm(state.pp1 ~ lobby.lead1 + lobby + lobby.lag1 + lobby.lag2 + log.pop | 
             fips + year, subset(dta, total.cog > 4 & state.pp1 < 2000))

m4 <- felm(state.pp1 ~ lobby.lead2 + lobby.lead1 + lobby + lobby.lag1 + lobby.lag2 + log.pop | 
             fips + year, subset(dta, total.cog > 4 & state.pp1 < 2000))


stargazer(m, m1, m2, m3, m4, type = "text", omit.table.layout = "sn",
          star.cutoffs = c(0.05), table.placement = "tb", 
          label = "table:transfers_leads_lags", font.size = "small",
          title = "City Lobbying and State Transfers: Lags and Leads",
          dep.var.caption = "State Transfers (Per Capita), $t + 1$", 
          dep.var.labels.include = FALSE,
          keep = c("lobby.lag2", "lobby.lag1", "lobby", "lobby.lead1", "lobby.lead2"),
          covariate.labels = c("Lobby, $t + 2$", "Lobby, $t + 1$", "Lobby, $t$",
                               "Lobby, $t - 1$", "Lobby, $t - 2$"),
          add.lines = list(c("City FE", "Yes", "Yes", "Yes", "Yes", "Yes"), 
                           c("Year FE", "Yes", "Yes", "Yes", "Yes", "Yes"),
                           c("Observations", pretty(N(m)), pretty(N(m1)),
                             pretty(N(m2)), pretty(N(m3)), pretty(N(m4))),
                           c("\\# Cities", pretty(num.cities(m)), 
                             pretty(num.cities(m1)), pretty(num.cities(m2)), 
                             pretty(num.cities(m3)), pretty(num.cities(m4))),
                           c("Mean Transfers Per Capita", getmean(m), getmean(m1), 
                             getmean(m2), getmean(m3), getmean(m4))))



###################################################################################################
## Table A5.6 Lags and Leads: California, Washington, and Florida
###################################################################################################

dta <- read.csv("~/Dropbox/Book/Data/CA_WA_FL.csv")

dta$state.by.year <- paste0(dta$state, dta$year)

m <- felm(state.pp1 ~ lobby + log.pop | city + state.by.year | 0 | city + state.by.year,  
          data = subset(dta, pop > 1000 & state.pp1 > 10 & state.pp1 < 4000))

m1 <- felm(state.pp1 ~ lobby.lead1 + lobby + log.pop | city + state.by.year | 0 | 
             city + state.by.year,  
           data = subset(dta, pop > 1000 & state.pp1 > 10 & state.pp1 < 4000))

m2 <- felm(state.pp1 ~ lobby.lead1 + lobby + lobby.lag1 + log.pop | 
             city + state.by.year | 0 | city + state.by.year,  
           data = subset(dta, pop > 1000 & state.pp1 > 10 & state.pp1 < 4000))


m3 <- felm(state.pp1 ~ lobby.lead1 + lobby + lobby.lag1 + lobby.lag2 + log.pop | 
             city + state.by.year | 0 | city + state.by.year,  
           data = subset(dta, pop > 1000 & state.pp1 > 10 & state.pp1 < 4000))


m4 <- felm(state.pp1 ~ lobby.lead2 + lobby.lead1 + lobby + lobby.lag1 + lobby.lag2 +
             log.pop | city + state.by.year | 0 | city + state.by.year,  
           data = subset(dta, pop > 1000 & state.pp1 > 10 & state.pp1 < 4000))

cities <- function(x) {
  length(which(getfe(x)=="city"))}


stargazer(m, m1, m2, m3, m4, type = "text", omit.table.layout = "s",
          title = "Lags and Leads: California, Washington, and Florida",
          dep.var.caption = "State Transfers (Per Capita)", 
          dep.var.labels.include = FALSE,
          keep = c("lobby.lag1", "lobby", "lobby.lead1", "lobby.lead2", 
                   "lobby.lead3"), star.cutoffs = c(0.05), 
          covariate.labels = c("Lobby, $t + 2$", "Lobby, $t + 1$", 
                               "Lobby, $t$", "Lobby, $t - 1$",
                               "Lobby, $t - 2$"),
          add.lines = list(c("City FE", "Yes", "Yes", "Yes", "Yes", "Yes"), 
                           c("Year FE", "Yes", "Yes", "Yes", "Yes", "Yes"),
                           c("Observations", pretty(N(m)), pretty(N(m1)),
                             pretty(N(m2)), pretty(N(m3)), pretty(N(m4))),
                           c("\\# Cities", pretty(cities(m1)), 
                             pretty(cities(m2)), pretty(cities(m3)), 
                             pretty(cities(m4)), pretty(cities(m4)))),
          notes = paste("Robust standard errors clustered by city. *p<0.05"),
          notes.append = FALSE, notes.align = "l", notes.label  = "")



###################################################################################################
## Table A5.7 Effect of Lobbying Expenditures on State Transfers
###################################################################################################


dta <- read.csv("city_lobby_finance.csv")

exp.states <- dta[dta$state=="Alaska" | dta$state == "Arizona" | dta$state == "California" | 
                    dta$state == "Colorado" | dta$state == "Connecticut" | dta$state == "Florida" |
                    dta$state == "Georgia" | dta$state == "Idaho" | dta$state == "Illinois" | 
                    dta$state == "Indiana" | dta$state == "Iowa" | dta$state == "Kentucky" |
                    dta$state == "Maine" | dta$state == "Massachusetts" | dta$state == "Michigan" |
                    dta$state == "Mississippi" | dta$state == "Montana" | dta$state == "Nebraska" |
                    dta$state == "New Jersey" | dta$state == "New York" | dta$state == "North Carolina" |
                    dta$state == "Oregon" | dta$state == "Pennsylvania" | dta$state == "South Carolina" |
                    dta$state == "Tennessee" | dta$state == "Texas" | dta$state == "Virginia" | 
                    dta$state == "Washington" | dta$state == "Wisconsin",]


## Drop extremeley low expenditure reports; create log and per person measures
exp.states$amount <- ifelse(exp.states$amount < 1000, 0, exp.states$amount)
exp.states$log.amount <- log(exp.states$amount + 1)
exp.states$lobby.pp <- exp.states$amount / exp.states$pop


## Note: drop extreme outliers for per person transfer measures
m <- felm(state.pp ~ lobby.pp + log.pop | fips + year | 0 | fips, 
          data = subset(exp.states, state.pp < 1000))

m1 <- felm(state.pp ~ lobby.pp + log.pop | fips + year | 0 | fips, 
           data = subset(exp.states, state.pp < 1000 & pop.cat == "small" | 
                           pop.cat == "medium"))

m2 <- felm(state.pp ~ lobby.pp + log.pop | fips + year | 0 | fips, 
           data = subset(exp.states, state.pp < 1000 & pop.cat == "big"))

m3 <- felm(state.pp ~ lobby.pp + log.pop | fips + year | 0 | fips, 
           data = subset(exp.states, state.pp < 1000 & pop.cat == "urban"))


stargazer(m, m1, m2, m3, omit.table.layout = "sn", type = "text", star.cutoffs = c(0.05),
          keep=c("lobby.pp"), covariate.labels = c("Lobby Expenditures (Per Capita)"), 
          title = c("\\textbf{Effect of Lobbying Expenditures on State Transfers.}"),
          dep.var.caption = "State Transfers (Per Capita)", 
          dep.var.labels.include = FALSE, 
          column.labels = c("Full Sample", "Under 50,000", 
                            "50,000 - 100,000", "Over 100,000"), 
          add.lines = list(c("City FEs", "Yes", "Yes", "Yes", "Yes", "Yes"),
                           c("State-Year FEs", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes"),
                           c("Observations", pretty(m$N), pretty(m1$N), pretty(m2$N),
                             pretty(m3$N)),
                           c("\\# Cities", pretty(num.cities(m)), pretty(num.cities(m1)),
                             pretty(num.cities(m2)), pretty(num.cities(m3))),
                           c("Mean Transfers", getmean(m), getmean(m1), getmean(m2), 
                             getmean(m3))))



###################################################################################################
## Table A5.8 Effect of Lobbying on State Transfers by Median Income
###################################################################################################

dta <- read.csv("city_lobby_finance.csv")

m <- felm(state.pp1 ~ lobby*log.inc + log.pop + log.inc + log.own.source + 
            pct.white + log.home  | fips + year, data = dta)

m1 <- felm(state.pp1 ~ lobby*log.inc + log.pop + log.inc + log.own.source + 
             pct.white + log.home  | fips + state.by.year, data = dta)


stargazer(m, m1, type = "text", omit.table.layout = "sn",
          star.cutoffs = c(0.05), table.placement = "tb", 
          label = "table:transfers_income", font.size = "small",
          title = c("\\textbf{Effect of Lobbying on State Transfers by Income Category}"),
          dep.var.caption = "State Transfers (Per Capita), $t + 1$", 
          dep.var.labels.include = FALSE,
          keep = c("lobby:log.inc"), order = c("lobby:log.inc"),
          covariate.labels = c("Lobby $\\times$ Median Income (Log)"),
          add.lines = list(c("City FE", "Yes", "Yes"), 
                           c("Year FE", "Yes", ""),
                           c("State-Year FE", "", "Yes"),
                           c("Observations", pretty(N(m)), pretty(N(m1))),
                           c("\\# Cities", pretty(num.cities(m)), 
                             pretty(num.cities(m1))),
                           c("Mean Transfer", getmean(m), getmean(m1))))



###################################################################################################
## On-Line Only Extensions
###################################################################################################


###################################################################################################
## Effect of Lobbying on State Transfers: Excluding Outliers (On-line SI)
###################################################################################################

dta <- read.csv("city_lobby_finance.csv")

m <- felm(state.pp ~ lobby + log.pop | fips + year | 0 | fips, 
          data = subset(dta, state.pp < 3000 & state.pp > 15))

m1 <- felm(state.pp ~ lobby + log.pop + log.inc + log.own.source + 
             pct.white + log.home | fips + year | 0 | fips,
           data = subset(dta, state.pp < 3000 & state.pp > 15))

m2 <- felm(state.pp ~ lobby + log.pop | fips + state.by.year | 0 | fips, 
           data = subset(dta, state.pp < 3000 & state.pp > 15))


m3 <- felm(state.pp ~ lobby + log.pop + log.inc + log.own.source + 
             pct.white + log.home | fips + state.by.year | 0 | fips, 
           data = subset(dta, state.pp < 3000 & state.pp > 15))


stargazer(m, m1, m2, m3, omit.table.layout = "s", type = "text", star.cutoffs = c(0.05),
          keep=c("lobby"), covariate.labels = c("Lobby"), 
          title = c("\\textbf{Effect of Lobbying on State Transfers (Per Capita).}"),
          dep.var.caption = "State Transfers (Per Capita), $t + 1$", 
          dep.var.labels.include = FALSE, 
          add.lines = list(c("City FEs", "Yes", "Yes", "Yes", "Yes"),
                           c("Year FEs", "Yes", "Yes", ""),
                           c("State-Year FEs", "", "", "Yes", "Yes"),
                           c("Full Controls", "", "Yes", "", "Yes"),
                           c("Observations", pretty(m$N), pretty(m1$N), 
                             pretty(m2$N), pretty(m3$N)),
                           c("\\# Cities", pretty(num.cities(m)), pretty(num.cities(m1)), 
                             pretty(num.cities(m2)), pretty(num.cities(m3))),
                           c("Mean Transfer", getmean(m), getmean(m1), 
                             getmean(m2), getmean(m3))),
          notes.append = FALSE, notes.align = "l", notes.label  = "",
          notes = "Robust standard errors clustered by city. $^{*}$p$<$0.05")



###################################################################################################
## Effect of Lobbying on State Transfers: Balanced Panel (On-line SI)
###################################################################################################

dta <- read.csv("city_lobby_finance.csv")

m <- felm(state.pp ~ lobby + log.pop | fips + year | 0 | fips, 
          data = subset(dta, total.cog > 4)) 


m1 <- felm(state.pp ~ lobby + log.pop + log.inc + log.own.source + 
             pct.white + log.home | fips + year | 0 | fips,
           data = subset(dta, total.cog > 4)) 


m2 <- felm(state.pp ~ lobby + log.pop | fips + state.by.year | 0 | fips, 
           data = subset(dta, total.cog > 4)) 


m3 <- felm(state.pp ~ lobby + log.pop + log.inc + log.own.source + 
             pct.white + log.home | fips + state.by.year | 0 | fips, 
           data = subset(dta, total.cog > 4)) 


stargazer(m, m1, m2, m3, omit.table.layout = "s", type = "text", star.cutoffs = c(0.05),
          keep=c("lobby"), covariate.labels = c("Lobby"), 
          title = c("\\textbf{Effect of Lobbying on State Transfers (Per Capita).} 
                    Excluding top and bottom 5%. State.pp"),
          dep.var.caption = "State Transfers (Per Capita), $t + 1$", 
          dep.var.labels.include = FALSE, 
          add.lines = list(c("City FEs", "Yes", "Yes", "Yes", "Yes"),
                           c("Year FEs", "Yes", "Yes", ""),
                           c("State-Year FEs", "", "", "Yes", "Yes"),
                           c("Full Controls", "", "Yes", "", "Yes"),
                           c("Observations", pretty(m$N), pretty(m1$N), 
                             pretty(m2$N), pretty(m3$N)),
                           c("\\# Cities", pretty(num.cities(m)), pretty(num.cities(m1)), 
                             pretty(num.cities(m2)), pretty(num.cities(m3))),
                           c("Mean Transfers Per Capita", getmean(m), getmean(m1), 
                             getmean(m2), getmean(m3))),
          notes.append = FALSE, notes.align = "l", notes.label  = "",
          notes = "Robust standard errors clustered by city. $^{*}$p$<$0.05")



###################################################################################################
## Effect of Lobbying on State Transfers: Logged Outcome (On-line SI)
###################################################################################################

dta <- read.csv("city_lobby_finance.csv")

m <- felm(log.state1 ~ lobby + log.pop | fips + year | 0 | fips, 
          data = dta)

m1 <- felm(log.state1 ~ lobby + log.pop | fips + year | 0 | fips, 
           data = subset(dta, pop.cat == "small" | pop.cat == "medium"))

m2 <- felm(log.state1 ~ lobby + log.pop | fips + year | 0 | fips, 
           data = subset(dta, pop.cat == "big"))

m3 <- felm(log.state1 ~ lobby + log.pop | fips + year | 0 | fips, 
           data = subset(dta, pop.cat == "urban"))


stargazer(m, m1, m2, m3, omit.table.layout = "s", type = "text", star.cutoffs = c(0.05),
          keep=c("lobby"), covariate.labels = c("Lobby"), 
          title = c("\\textbf{Effect of Lobbying on State Transfers (Logged)}"),
          dep.var.caption = "State Transfers (Logged)", 
          dep.var.labels.include = FALSE, 
          column.labels = c("Full Sample", "Under 50,000", "50,000 - 100,000", "Over 100,000"), 
          add.lines = list(c("City FEs", "Yes", "Yes", "Yes", "Yes"),
                           c("Year FEs", "Yes", "Yes", "Yes", "Yes"),
                           c("Observations", pretty(m$N), pretty(m1$N), 
                             pretty(m2$N), pretty(m3$N)),
                           c("\\# Cities", pretty(num.cities(m)), pretty(num.cities(m1)), 
                             pretty(num.cities(m2)), pretty(num.cities(m3))),
                           c("Mean Transfers Per Capita", getmean(m), getmean(m1), 
                             getmean(m2), getmean(m3))),
          notes.append = FALSE, notes.align = "l", notes.label  = "",
          notes = "Robust standard errors clustered by city. $^{*}$p$<$0.05")



###################################################################################################
## Effect of Lobbying by City Median Income: Binned Approach (On-line SI)
###################################################################################################

dta <- read.csv("city_lobby_finance.csv")

dta$inc.tercile <- cut(dta$median.income, breaks = quantile(dta$median.income, 
                                                            probs = c(0, .33, .66, 1), na.rm = T),
                       include.lowest = TRUE, labels = c("Bottom Tercile", "Middle Tercile", "Upper Tercile"))


m <- felm(state.pp1 ~ lobby*inc.tercile + log.pop + log.inc + log.own.source + 
            pct.white + log.home  | fips + year, data = dta)

m1 <- felm(state.pp1 ~ lobby*inc.tercile + log.pop + log.inc + log.own.source + 
             pct.white + log.home  | fips + state.by.year, data = dta)

stargazer(m, m1, type = "text", omit.table.layout = "s", star.cutoffs = c(0.05),
          title = c("\\textbf{Effect of Lobbying on State Transfers by Income Category}"),
          dep.var.caption = "State Transfers (Per Capita), $t + 1$", 
          dep.var.labels.include = FALSE,
          keep = c("lobby", "inc.tercileMiddle Tercile", "inc.tercileUpper Tercile",
                   "lobby:inc.tercileMiddle Tercile", "lobby:inc.tercileUpper Tercile"),
          covariate.labels = c("Lobby (Bottom Tercile)", "Medium Income Tercile", 
                               "Top Income Tercile", "Lobby x Medium Income Tercile", 
                               "Lobby x Top Income Tercile"),
          add.lines = list(c("City FE", "Yes", "Yes"), 
                           c("Year FE", "Yes", ""),
                           c("State-Year FE", "", "Yes"),
                           c("Observations", pretty(N(m)), pretty(N(m1))),
                           c("\\# Cities", pretty(num.cities(m)), 
                             pretty(num.cities(m1))),
                           c("Mean Transfer", getmean(m), getmean(m1))),
          notes = paste("Robust standard errors clustered by city. *p<0.05"),
          notes.append = FALSE, notes.align = "l", notes.label  = "")

